package com.weixx.yctp.cp.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import cc.eamon.open.mapping.mapper.Mapper;
import cc.eamon.open.mapping.mapper.MapperExtra;
import cc.eamon.open.mapping.mapper.MapperIgnore;
import cc.eamon.open.mapping.mapper.MapperModify;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * @author 
 * 
 */
@Table(name="cp_cp")
@Data
@Mapper({"post", "update", "simple", "detail"})
@MapperExtra(
        value = {"detail", "detail", "post","update"},
        list = true,
        name = {"roles", "permits", "roles", "roles"},
        type = {
                "java.util.Map",
                "java.util.Map",
                "java.lang.Integer",
                "java.lang.Integer"
        }
)
public class Cp implements Serializable {
    /**
     * Id
     */
    @Id
    @MapperIgnore({"post"})
    private Integer id;

    /**
     * 1市发改委
     */
    @NotEmpty
    private Integer sfgw;

    /**
     * 市发改委_备注1
     */
    private String sfgw_BZ;

    /**
     * 2市经信局
     */
    @NotEmpty
    private Integer sjxj;

    /**
     * 市经信局_备注2
     */
    private String sjxj_BZ;

    /**
     * 3市财政局
     */
    @NotEmpty
    private Integer sczj;

    /**
     * 市财政局_备注3
     */
    private String sczj_BZ;

    /**
     * 4市市场监管局
     */
    @NotEmpty
    private Integer sscjgj;

    /**
     * 市市场监管局_备注4
     */
    private String sscjgj_BZ;

    /**
     * 5市自然资源和规划局
     */
    @NotEmpty
    private Integer szrzyhghj;

    /**
     * 市自然资源和规划局_备注5
     */
    private String szrzyhghj_BZ;

    /**
     * 6市林业和园林局
     */
    @NotEmpty
    private Integer slyhylj;

    /**
     * 市林业和园林局_备注6
     */
    private String slyhylj_BZ;

    /**
     * 7市农业农村局
     */
    @NotEmpty
    private Integer snyncj;

    /**
     * 市农业农村局_备注7
     */
    private String snyncj_BZ;

    /**
     * 8市政务服务和大数据管理局
     */
    @NotEmpty
    private Integer szwfwhdsjglj;

    /**
     * 市政务服务和大数据管理局_备注8
     */
    private String szwfwhdsjglj_BZ;

    /**
     * 9市生态环境局
     */
    @NotEmpty
    private Integer ssthjj;

    /**
     * 市生态环境局_备注9
     */
    private String ssthjj_BZ;

    /**
     * 10市应急管理局
     */
    @NotEmpty
    private Integer syjglj;

    /**
     * 市应急管理局_备注10
     */
    private String syjglj_BZ;

    /**
     * 11市水利湖泊局
     */
    @NotEmpty
    private Integer sslhpj;

    /**
     * 市水利湖泊局_备注11
     */
    private String sslhpj_BZ;

    /**
     * 12市文化和旅游局
     */
    @NotEmpty
    private Integer swhhlyj;

    /**
     * 市文化和旅游局_备注12
     */
    private String swhhlyj_BZ;

    /**
     * 13市住建局
     */
    @NotEmpty
    private Integer szjj;

    /**
     * 市住建局_备注13
     */
    private String szjj_BZ;

    /**
     * 14市供电公司
     */
    @NotEmpty
    private Integer sgdgs;

    /**
     * 市供电公司_备注14
     */
    private String sgdgs_BZ;

    /**
     * 15市消防救援支队
     */
    @NotEmpty
    private Integer sxfjyzd;

    /**
     * 市消防救援支队_备注15
     */
    private String sxfjyzd_BZ;

    /**
     * 16市人防办
     */
    @NotEmpty
    private Integer srfb;

    /**
     * 市人防办_备注16
     */
    private String srfb_BZ;

    /**
     * 17市气象局
     */
    @NotEmpty
    private Integer sqxj;

    /**
     * 市气象局_备注17
     */
    private String sqxj_BZ;

    /**
     * 18宜昌三峡水务有限公司
     */
    @NotEmpty
    private Integer ycsxswyxgs;

    /**
     * 宜昌三峡水务有限公司_备注18
     */
    private String ycsxswyxgs_BZ;

    /**
     * 19宜昌中燃城市燃气有限公司
     */
    @NotEmpty
    private Integer yczrcsrqyxgs;

    /**
     * 宜昌中燃城市燃气有限公司_备注19
     */
    private String yczrcsrqyxgs_BZ;

    /**
     * 登录IP地址
     */
    @NotEmpty
    private String ipAddress;

    /**
     * 问卷标记
     */
    private String mark;

    /**
     * 问卷标记人
     */
    private String markName;

    /**
     * 问卷批次记录
     */
    @NotEmpty
    private String pcTime;

    /**
     * 创建时间
     */
    @NotEmpty
    @MapperIgnore({"post", "update"})
    @MapperModify(
            value = {"post", "update", "simple", "detail", "default"},
            modify = {"modifyTime", "modifyTime", "modifyTime", "modifyTime", "modifyTime"},
            recover = {"recoverTime", "recoverTime", "recoverTime", "recoverTime", "recoverTime"}
    )
    private Date createTime;

    /**
     * 创建操作人
     */
    @NotEmpty
    @MapperIgnore({"post", "update"})
    private String createBy;

    /**
     * 更新时间
     */
    @NotEmpty
    @MapperIgnore({"post", "update"})
    @MapperModify(
            value = {"post", "update", "simple", "detail", "default"},
            modify = {"modifyTime", "modifyTime", "modifyTime", "modifyTime", "modifyTime"},
            recover = {"recoverTime", "recoverTime", "recoverTime", "recoverTime", "recoverTime"}
    )
    private Date updateTime;

    /**
     * 更新操作人
     */
    @NotEmpty
    @MapperIgnore({"post", "update"})
    private String updateBy;

    /**
     * 删除状态
     */
    @NotEmpty
    @MapperIgnore({"post", "update", "simple", "detail"})
    private Byte isDelete;

    /**
     * 保留字段1
     */
    private String expand1field;

    /**
     * 保留字段2
     */
    private String expand2field;

    /**
     * 保留字段3
     */
    @MapperIgnore({"post", "update", "simple", "detail"})
    private String expand3field;

    /**
     * 保留字段4
     */
    @MapperIgnore({"post", "update", "simple", "detail"})
    private String expand4field;

    /**
     * 保留字段5
     */
    @MapperIgnore({"post", "update", "simple", "detail"})
    private String expand5field;

    private static final long serialVersionUID = 1L;


    public Long modifyTime(Date date) {
        if (date == null) return null;
        return date.getTime();
    }

    public Date recoverTime(Long time) {
        if (time == null) return null;
        return new Date(time);
    }
}